% rastrigin test fitness function
% input x: the x value
function [val] = Rastrigin(x)
	a = 2;
	N = 30;
	val = 0;
	for i=1:N
		val = val + (a-a*cos(2*pi*x(i)) + x(i)^2);
	endfor
endfunction